package com.dxb.test.thread;

/**
 * ClassName：com.dxb.test.thread.Wait <br>
 * Description：TODO <br>
 *
 * @author 戴晓波 <br>
 * Date 2021/10/18/018 10:46 <br>
 * @version v1.0 <br>
 */
public class Wait {
    public static void main(String[] args) throws InterruptedException {

        Thread thread = new Thread(() -> {
            System.out.println("in start");
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("in over");
        });
        thread.start();
        thread.join(1000);
        System.out.println("out over");
    }
}
